import { INTEGER_PG } from "~/db.pg";

import { Voucher, VoucherGroup } from "./schema.voucher";
import { VoucherGateway, VoucherGroupGateway } from "./dto.voucher";

export const VoucherRpcGetGroupPath = `${VoucherGroupGateway.path}/getGroup`;
export type getVoucherGroupRpcDto = { ids: INTEGER_PG[] };

export const VoucherRpcGetPath = `${VoucherGateway.path}/getPath`;
export type getVoucherRpcDto = { ids: Voucher["uuid32"][] };

export interface VoucherComRpcInterface<T> {
  getGroup(dto: T & getVoucherGroupRpcDto): Promise<{ entityLs: VoucherGroup[] }>;
  get(dto: T & getVoucherRpcDto): Promise<{ entityLs: Voucher[] }>;
}
